home *** CD-ROM | disk | FTP | other *** search
- property s, mysmallloc, mysmallwidth, mysmallheight, mymediumloc, mymediumwidth, mymediumheight, mybwmember, mycolormember, mysmallrect, mymediumrect, mypercent, fullon, insmall, inmedium, scaleup, scaledown, scalepercent, mymerit, mymovestart, myDelay, goscreenshot, mycurrwidth, mycurrheight, mycurrloc, mybigmember, switchedtext
- global learnedsizes, tickrate, firstthumbnail, screenshotloc, screenshotwidth, screenshotheight, currtitle, rollvolume, rollstep
-
- on beginSprite me
- s = me.spriteNum
- mycolormember = the memberNum of sprite s
- bwmember = member(mycolormember).name
- delete char -30001 of bwmember
- if the last char in bwmember = SPACE then
- delete char -30000 of bwmember
- end if
- put " bw" after bwmember
- bigmember = member(mycolormember).name
- delete char -30001 of bigmember
- if the last char in bigmember = SPACE then
- delete char -30000 of bigmember
- end if
- put " big" after bwmember
- mybwmember = the number of member bwmember
- mybigmember = the number of member bigmember
- mypercent = 100
- insmall = 0
- inmedium = 0
- mymerit = word 1 of bwmember
- goscreenshot = 0
- end
-
- on learnsmallsize me
- mysmallloc = the loc of sprite s
- mysmallwidth = the width of sprite s
- mysmallheight = the height of sprite s
- mysmallrect = the rect of sprite s
- end
-
- on learnmediumsize me
- mymediumloc = the loc of sprite s
- mymediumwidth = the width of sprite s
- mymediumheight = the height of sprite s
- mymediumrect = the rect of sprite s
- end
-
- on prepareFrame me
- if not learnedsizes then
- exit
- end if
- if goscreenshot then
- moveicontoscreen()
- exit
- end if
- if scaleup or scaledown then
- moveicon()
- exit
- end if
- if the memberNum of sprite s = mybigmember then
- exit
- end if
- onsmallloc = the loc of sprite s = mysmallloc
- onmediumloc = the loc of sprite s = mymediumloc
- if (inside(the mouseLoc, mysmallrect) and onsmallloc) or sprite(s + 100).insmall then
- insmall = 1
- end if
- if (inside(the mouseLoc, mymediumrect) and onmediumloc) or sprite(s + 100).insmall then
- inmedium = 1
- end if
- if insmall or inmedium then
- rollvolume = rollvolume + rollstep
- sprite(s + 100).inpartner = 1
- if mypercent = 100 then
- insmall = inside(the mouseLoc, mysmallrect) and onsmallloc
- inmedium = inside(the mouseLoc, mymediumrect) and onmediumloc
- exit
- end if
- mypercent = min(100, mypercent + tickrate)
- else
- sprite(s + 100).inpartner = 0
- if mypercent = 0 then
- exit
- end if
- mypercent = max(0, mypercent - tickrate)
- end if
- if mypercent >= 50 then
- set the memberNum of sprite s to mycolormember
- else
- set the memberNum of sprite s to mybwmember
- end if
- if onsmallloc then
- newwidth = float(mysmallwidth) / 100 * (abs(50 - mypercent) * 2)
- set the width of sprite s to newwidth
- set the height of sprite s to mysmallheight
- end if
- if onmediumloc then
- newwidth = float(mymediumwidth) / 100 * abs(50 - mypercent) * 2
- set the width of sprite s to newwidth
- set the height of sprite s to mymediumheight
- end if
- end
-
- on mouseUp me, fromlist, thetitle
- if fromlist = 1 then
- if thetitle = (s - firstthumbnail + 1) then
- currtitle = thetitle
- sendSprite(s, #growdown, mymerit, thetitle)
- end if
- exit
- end if
- onsmallloc = the loc of sprite s = mysmallloc
- onmediumloc = the loc of sprite s = mymediumloc
- if onsmallloc then
- sendAllSprites(#growup, mymerit)
- end if
- if onmediumloc then
- sprite(s).locZ = 1000
- currtitle = thetitle
- sendAllSprites(#growdown, mymerit, s - firstthumbnail + 1)
- end if
- end
-
- on growdown me, themerit, thetitle
- if the loc of sprite s = screenshotloc then
- sprite(s).locZ = 1000
- else
- sprite(s).locZ = s
- end if
- mycurrwidth = the width of sprite s
- mycurrheight = the height of sprite s
- mycurrloc = the loc of sprite s
- if thetitle = (s - firstthumbnail + 1) then
- goscreenshot = 1
- scaleup = 0
- scaledown = 0
- switchedtext = 0
- set the memberNum of sprite s to mybigmember
- scalepercent = 0
- exit
- end if
- goscreenshot = 0
- if mymerit = themerit then
- scaledown = 1
- scaleup = 0
- scalepercent = 100
- mymovestart = the ticks
- myDelay = random(60)
- end if
- end
-
- on growup me, themerit
- if the loc of sprite s = screenshotloc then
- sprite(s).locZ = 1000
- else
- sprite(s).locZ = s
- end if
- if mymerit = themerit then
- scaledown = 0
- scaleup = 1
- scalepercent = 0
- mymovestart = the ticks
- myDelay = random(30)
- mycurrwidth = the width of sprite s
- mycurrheight = the height of sprite s
- mycurrloc = the loc of sprite s
- else
- if the loc of sprite s <> mysmallloc then
- growdown(me, mymerit)
- end if
- end if
- end
-
- on moveicon
- if the ticks < (mymovestart + myDelay) then
- exit
- end if
- if scaleup then
- if (the loc of sprite s <> mymediumloc) or (scalepercent < 100) then
- if scalepercent = 100 then
- set the loc of sprite s to mymediumloc
- else
- set the locH of sprite s to mycurrloc.locH + (float(mymediumloc.locH - mycurrloc.locH) / 100 * scalepercent)
- set the locV of sprite s to mycurrloc.locV + (float(mymediumloc.locV - mycurrloc.locV) / 100 * scalepercent)
- scalepercent = min(100, scalepercent + tickrate)
- end if
- else
- if (the width of sprite s <> mymediumwidth) or (the height of sprite s <> mymediumheight) then
- set the width of sprite s to mycurrwidth + (float(mymediumwidth - mycurrwidth) / 100 * (scalepercent - 100))
- set the height of sprite s to mycurrheight + (float(mymediumheight - mycurrheight) / 100 * (scalepercent - 100))
- scalepercent = min(200, scalepercent + tickrate)
- else
- scaleup = 0
- set the memberNum of sprite s to mybwmember
- end if
- end if
- exit
- end if
- if scaledown then
- if (the width of sprite s <> mysmallwidth) or (the height of sprite s <> mysmallheight) then
- set the width of sprite s to mysmallwidth + (float(mycurrwidth - mysmallwidth) / 100 * scalepercent)
- set the height of sprite s to mysmallheight + (float(mycurrheight - mysmallheight) / 100 * scalepercent)
- scalepercent = max(0, scalepercent - tickrate)
- else
- if the loc of sprite s <> mysmallloc then
- set the locH of sprite s to mysmallloc.locH + (float(mycurrloc.locH - mysmallloc.locH) / 100 * (scalepercent + 100))
- set the locV of sprite s to mysmallloc.locV + (float(mycurrloc.locV - mysmallloc.locV) / 100 * (scalepercent + 100))
- scalepercent = max(-100, scalepercent - tickrate)
- else
- scaledown = 0
- set the memberNum of sprite s to mybwmember
- end if
- end if
- exit
- end if
- end
-
- on moveicontoscreen
- sprite(s).locZ = 1000
- if (the loc of sprite s <> screenshotloc) or (scalepercent < 100) then
- if scalepercent = 100 then
- set the loc of sprite s to screenshotloc
- else
- set the locH of sprite s to mycurrloc.locH + (float(screenshotloc.locH - mycurrloc.locH) / 100 * scalepercent)
- set the locV of sprite s to mycurrloc.locV + (float(screenshotloc.locV - mycurrloc.locV) / 100 * scalepercent)
- scalepercent = min(100, scalepercent + tickrate)
- end if
- else
- if not switchedtext then
- sendAllSprites(#switchtext, s - firstthumbnail + 1)
- currtitle = s - firstthumbnail + 1
- switchedtext = 1
- end if
- if (the width of sprite s <> screenshotwidth) or (the height of sprite s <> screenshotheight) then
- if scalepercent = 200 then
- set the width of sprite s to screenshotwidth
- set the height of sprite s to screenshotheight
- else
- set the width of sprite s to mycurrwidth + (float(screenshotwidth - mycurrwidth) / 100 * (scalepercent - 100))
- set the height of sprite s to mycurrheight + (float(screenshotheight - mycurrheight) / 100 * (scalepercent - 100))
- scalepercent = min(200, scalepercent + tickrate)
- end if
- else
- set the loc of sprite s to screenshotloc
- goscreenshot = 0
- end if
- end if
- exit
- end
-
- on checkclick me, clickedloc
- if inside(clickedloc, mymediumrect) and (the loc of sprite s = mymediumloc) then
- mouseUp()
- end if
- end
-